import Express from 'express'
import Captcha from 'svg-captcha'
export const captchaRouter = Express.Router()
captchaRouter.get('/', async (req, res) => {
    const obj = Captcha.create({
        size: 4,
        ignoreChars: '0o1i',
        noise: 0,
        color: true
    });
    req.session.code = obj.text
    console.log(obj.text);
    
    // res.send(obj)
    res.json({
        code:0,
        data:obj.data,
        msg:"ok"
    })
})